package com.sweet.thread.unsafe;

import java.util.ArrayList;
import java.util.List;

public class UnsafeArrayList {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        for (int i = 0; i < 1000000; i++) {
            new Thread(()->{
                //synchronized (list) {
                    list.add(Thread.currentThread().getName());
                //}
            }).start();
        }
        System.out.println(list.size());
    }
}
